<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- 此处绑定的isShow是实例中的isShow -->
        <cpn v-show="isShow"></cpn>
        <h2>isShow,,,:::{{isShow}}</h2>

    </div>


    <template id="CPN">
       <div>
        <h2>我是子组件的标题</h2>
        <p>我是子组件的内容</p>
        <h2 v-show="isShow">我是子组件，我是用的是子组件中的isShow,,,:::{{isShow}}</h2>
       </div>
    </template>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                message: '我是你爹!',
                isShow: true,
            },
            methods: {},
            components: {
                cpn: {
                    template: '#CPN',
                    data() {
                        return {
                            isShow: true,
                        }
                    }
                }
            }
        });
    </script>
</body>

</html>